package com.prs.crm.action.hr;

import java.util.Collection;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;

import com.prs.crm.context.AppContext;
import com.prs.crm.domain.hr.LeaveAudit;
import com.prs.crm.domain.hr.Payroll;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.hr.Train;
import com.prs.crm.service.hr.LeaveAuditService;
import com.prs.crm.service.hr.PayrollService;
import com.prs.crm.service.hr.TrainService;

public class IndexAction  extends BaseAction{
	private TrainService trainService;
	private PayrollService payrollService;	
	private LeaveAuditService leaveAuditService;
	
	private Collection<LeaveAudit> leaveAudits;
	private Collection<Train> trains;
	private Collection<Payroll> payrolls;
	
	@Action("index")
	public String index() {
		Person person = AppContext.getAccountContext().currentUser();
		leaveAudits = this.getLeaveAuditService().getAuditLeave(person);
		trains = this.getTrainService().getTrainByPerson(person);
		payrolls = this.getPayrollService().getPayrollByPerson(person);
		return SUCCESS;
	}

	public TrainService getTrainService() {
		return trainService;
	}

	public void setTrainService(TrainService trainService) {
		this.trainService = trainService;
	}

	public PayrollService getPayrollService() {
		return payrollService;
	}

	public void setPayrollService(PayrollService payrollService) {
		this.payrollService = payrollService;
	}

	public LeaveAuditService getLeaveAuditService() {
		return leaveAuditService;
	}

	public void setLeaveAuditService(LeaveAuditService leaveAuditService) {
		this.leaveAuditService = leaveAuditService;
	}

	public Collection<LeaveAudit> getLeaveAudits() {
		return leaveAudits;
	}

	public void setLeaveAudits(Collection<LeaveAudit> leaveAudits) {
		this.leaveAudits = leaveAudits;
	}

	public Collection<Train> getTrains() {
		return trains;
	}

	public void setTrains(Collection<Train> trains) {
		this.trains = trains;
	}

	public Collection<Payroll> getPayrolls() {
		return payrolls;
	}

	public void setPayrolls(Collection<Payroll> payrolls) {
		this.payrolls = payrolls;
	}
}
